#include "RaffleActivity.h"

#include <iostream>
using namespace std;

DispenseState::DispenseState(RaffleActivity* activity)
{
    _activity = activity;
}

void DispenseState::DeductMoney()
{
    cout << "DispenseState::DeductMoney()" << endl;
}

bool DispenseState::Raffle()
{
    cout << "DispenseState::Raffle()" << endl;
    return false;
}

void DispenseState::DispensePrize()
{
    cout << "DispenseState::DispensePrize()" << endl;
    if (_activity->GetCount() > 0) {
        cout << "success" << endl;
        _activity->SetState(_activity->GetNoRaffleState());
    } else {
        cout << "failed" << endl;
        _activity->SetState(_activity->GetDispenseOutState());
    }
}